IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[ReviewCOI]') AND type in (N'P', N'PC'))
DROP PROCEDURE [dbo].[ReviewCOI]
GO

SET QUOTED_IDENTIFIER OFF
GO
/******************************************************************        
* Name:    [ReviewCOI]        
* Purpose:   Updates the review date and status to 'Reviewed' for the passed in COIId(note: only with status 'Submitted')      
* PARAMETERS(IN)        
* Name    Description             
* -------------      -------------------------------------------        
* @coiId   COIId to be reviewed         
*********************************************************************/        
        
CREATE PROCEDURE [dbo].[ReviewCOI]        
(        
 @coiId int,
 @reviewerPersonId int       
)        
AS BEGIN        
SET NOCOUNT ON        
       
	Update ConflictOfInterest SET       
	  DateReviewed=GetDate(),      
	  Status='COISTATUS_REVIEWED',
	  ReviewerPersonId = @reviewerPersonId      
	Where      
	  Id = @coiId          
END 